package code

const (
	ErrInvalidParams = 10001
	ErrNotFound      = 10002
	ErrUnauthorized  = 10003
	ErrForbidden     = 10004
)

var errorMessages = map[int]string{
	ErrInvalidParams: "参数验证失败",
	ErrNotFound:      "资源不存在",
	ErrUnauthorized:  "未授权",
	ErrForbidden:     "禁止访问",
}

func GetErrorMessage(code int) string {
	if msg, ok := errorMessages[code]; ok {
		return msg
	}
	return "未知错误"
}
